import * as constants from '../Constants'
import { get, GET_TYPE_INFO_LIST, GET_DATA_PIC_LIST } from '../../service/api'


export interface GetCateInfoList {
  type: constants.GetCateInfoList
  payload: Promise<any>
}

export interface GetCateInfoList_PENDING {
  type: constants.GetCateInfoList_PENDING
  payload: Promise<any>
}

export interface GetCateInfoList_FULFILLED {
  type: constants.GetCateInfoList_FULFILLED
  payload: any
}

export interface GetCateInfoList_PAGE {
  type: constants.GetCateInfoList_PAGE
  payload: any
}

export interface GetCatePicList {
  type: constants.GetCatePicList
  payload: Promise<any>
}
export interface GetCatePicList_PENDING {
  type: constants.GetCatePicList_PENDING
  payload: Promise<any>
}
export interface GetCatePicList_FULFILLED {
  type: constants.GetCatePicList_FULFILLED
  payload: any
}
export interface GetCatePicList_Type {
  type: constants.GetCatePicList_Type
  payload: number
}
export interface RECORD_CatePic {
  type: constants.RECORD_Data_Pic
  payload: Promise<any>
}
export interface RECORD_CatePic_FULFILLED {
  type: constants.RECORD_Data_Pic_FULFILLED
  payload: any
}

export type CateInfoAction = GetCateInfoList | 
  GetCateInfoList_FULFILLED | 
  GetCateInfoList_PENDING | 
  GetCateInfoList_PAGE |
  RECORD_CatePic |
  RECORD_CatePic_FULFILLED |
  GetCatePicList | 
  GetCatePicList_FULFILLED | 
  GetCatePicList_PENDING |
  GetCatePicList_Type

export function recordType(param: number): GetCatePicList_Type {
return {
    type: constants.GetCatePicList_Type,
    payload: param
}
}

export function getCatePicList(param: any): GetCatePicList {
return {
    type: constants.GetCatePicList,
    payload: get(GET_DATA_PIC_LIST, param)
}
}

export function GetCateInfoList(param: any): GetCateInfoList {
  return {
    type: constants.GetCateInfoList,
    payload: get(GET_TYPE_INFO_LIST, param)
  }
}
// export function recordCatePic(param: any): RECORD_CatePic {
//   return {
//     type: constants.RECORD_Data_Pic,
//     payload: get(GET_CateInfo_BY_ID, param)
//   }
// }
export function page(page: any): GetCateInfoList_PAGE {
  return {
    type: constants.GetCateInfoList_PAGE,
    payload: page
  }
}

